﻿// ***********************************************************************
// Assembly         : Zf3DPlatform
// Author           : tianteng
// Created          : 02-10-2018
//
// Last Modified By : tianteng
// Last Modified On : 02-10-2018
// ***********************************************************************
// <copyright file="SelectModelUtil.cs" company="北京智帆高科科技有限公司">
//     Copyright ©  2017
// </copyright>
// <summary></summary>
// ***********************************************************************
using System;
using OSS.BIM.Business.Utility;
using OSS.BIM.Model;
using OSS.BIM.SceneManage;
using ZFGK.osgEarth.UI.Utility;

namespace OSS.BIM.SceneManage
{
    /// <summary>
    /// Class SelectModelUtil.
    /// </summary>
    public static class SelectModelUtil
    {
        /// <summary>
        /// Picks the ModelElement.
        /// </summary>
        /// <param name="actionUtility">The action utility.</param>
        /// <param name="userModel">The ModelElement.</param>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
        public static bool PickUserModel(this OeViewActionUtility actionUtility, out ModelElement userModel)
        {
            userModel = null;
            string modelName;
            // 选择一个模型
            if (!actionUtility.PickEarthModel("选择模型", userModel.GetGroupName(), out modelName))
                return false;

            userModel = ModelElementDbUtil.GetAt(Convert.ToInt32(modelName));
            return true;
        }

        /// <summary>
        /// Picks the design surface.
        /// </summary>
        /// <param name="actionUtility">The action utility.</param>
        /// <param name="designSurface">The design surface.</param>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
        //public static bool PickDesignSurface(this ActionUtility actionUtility, out DbDesignSurface designSurface)
        //{
        //    designSurface = null;
        //    string modelName;
        //    // 选择一个模型
        //    if (!actionUtility.MouseClick("选择净空面", "按ESC退出选择", DbDesignSurfaceModelUtil.DesignSurfaceModelGroupName, out modelName))
        //        return false;

        //    designSurface = DesignSurfaceDbUtil.GetAt(Convert.ToInt32(modelName));
        //    return true;
        //}
    }
}
